{extend name="common:base" /}

{block name="title"}注册 - {$config.site_name}{/block}

{block name="css"}
  <link href="/static/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
{/block}

{block name="main"}
<div class="mdui-container">
  <main>
    <div class="mdui-row">
      <div class="register-container">
        <div class="panel mdui-col-sm-6 mdui-col-md-6 mdui-col-offset-sm-3 mdui-col-offset-md-3">
          <div class="panel-header">注册账号</div>
          <div class="panel-body-box">
            <form action="{:url('auth/register')}" method="post">
              {include file="common:alert"}
              <div class="mdui-textfield mdui-textfield-floating-label">
                <label class="mdui-textfield-label">用户名</label>
                <input class="mdui-textfield-input" type="text" name="username" maxlength="15" value="{:input('post.username')}"/>
              </div>
              <div class="mdui-textfield mdui-textfield-floating-label">
                <label class="mdui-textfield-label">邮箱</label>
                <input class="mdui-textfield-input" type="email" name="email" value="{:input('post.email')}"/>
              </div>
              <div class="mdui-textfield mdui-textfield-floating-label">
                <label class="mdui-textfield-label">密码</label>
                <input class="mdui-textfield-input" type="password" name="password" value="{:input('post.password')}"/>
              </div>
              <div class="mdui-textfield mdui-textfield-floating-label">
                <label class="mdui-textfield-label">确认密码</label>
                <input class="mdui-textfield-input" type="password" name="password_confirm"/>
              </div>
              <div class="mdui-textfield mdui-textfield-floating-label">
                <label class="mdui-textfield-label">验证码</label>
                <input class="mdui-textfield-input" type="text" name="captcha" maxlength="5" autocomplete="off"/>
                <img src="{:captcha_src()}" class="captcha" onclick="this.src = '{:captcha_src()}' + '?t=' + new Date().getTime()" alt="验证码">
              </div>
              <div class="mdui-textfield mdui-textfield-floating-label">
                {if $config.close_register}
                <button class="mdui-btn mdui-btn-block mdui-color-theme-accent mdui-ripple" disabled>已关闭注册</button>
                {else /}
                <button class="mdui-btn mdui-btn-block mdui-color-theme-accent mdui-ripple">注册</button>
                {/if}
              </div>
              {:token()}
            </form>
            <p class="mdui-clearfix mdui-m-t-1">
              已有账号？<a href="{:url('auth/login')}">登录</a>
            </p>
          </div>
        </div>
      </div>
    </div>
    {if $config.close_register}
    <div class="mask">
      <div class="content">
        <div class="panel-box">
          <h3>站点已关闭注册</h3>
        </div>
      </div>
    </div>
    {/if}
  </main>
</div>
{/block}

{block name="js"}
<script src="/static/bootstrap/3.3.7/js/bootstrap.min.js"></script>
{/block}
